[MTR04] W2 D12 練習三


Posted by Christy on 2020-07-16

練習三:寫一個能夠印出 n 個 的函式
寫一個函式 star,接收一個參數 n,並印出 n 個

(禁止使用內建函式 repeat)

star(1) 預期輸出:
*

star(5) 預期輸出:


star(10) 預期輸出:


function star(n){
 for (i = 1; i<=n; i++) {
}
console.log(star(1))

中間少了星星,應該有要擺的地方,明天繼續研究。










Related Posts

原型與繼承(3) - class

原型與繼承(3) - class

[ 筆記 ] Express 03 - Deployment

[ 筆記 ] Express 03 - Deployment

第五天:爬蟲【三】

第五天:爬蟲【三】


Comments